package com.supor.aiot.mine.api;

import com.android.baseconfig.base.BaseApiResult;
import com.android.baseconfig.base.DataApiResult;
import com.supor.aiot.common.app.Constants;
import com.supor.aiot.mine.bean.WishBean;

import java.util.List;

import io.reactivex.rxjava3.core.Observable;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.HTTP;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;

/**
 * ---------------------------------------------------------------- <br>
 * Copyright (C) 2014-2020, by het, Shenzhen, All rights reserved.  <br>
 * ---------------------------------------------------------------- <br>
 * <p>
 * 描述: UserService <br>
 * 作者: lei <br>
 * 日期: 2020/11/7 <br>
 */
public interface WishService {

    /**
     * 2.3.1	新增心愿单接口
     *
     * @param WishBean wishBean
     * @return BaseApiResult<String>
     */
    @POST(Constants.OSS_API + "bossTUserWish")
    Observable<BaseApiResult<String>> addWish(@Body WishBean wishBean);

    /**
     * 2.3.2	更新心愿单接口
     *
     * @param WishBean wishBean
     * @return BaseApiResult<String>
     */
    @PUT(Constants.OSS_API + "bossTUserWish")
    Observable<BaseApiResult<String>> updateWish(@Body WishBean wishBean);

    /**
     * 2.3.4	心愿单分页查询接口
     *
     * @param page 页码
     * @param limit 大小
     * @return BaseApiResult<DataApiResult<List<WishBean>>>>>
     */
    @GET(Constants.OSS_API + "bossTUserWish/page")
    Observable<BaseApiResult<DataApiResult<List<WishBean>>>> getWishList(@Query(
            "page") int page, @Query("limit") int limit);

    /**
     * 2.3.5	删除心愿单接口
     *
     * @param wishId 心愿单id
     * @return BaseApiResult<String>
     */
    // @DELETE(Constants.OSS_API + "wish/page")
    @HTTP(method = "DELETE", path = Constants.OSS_API + "bossTUserWish/{id}", hasBody= true)
    Observable<BaseApiResult<String>> deleteWish(@Path("id") String wishId);
}
